﻿using DocumentFormat.OpenXml.Office2010.Excel;
using NetTopologySuite.Geometries;
using NPOI.SS.Formula.Functions;
using System;
using System.ComponentModel.DataAnnotations;
using static housingsafety.server.Controllers.VillageMngController;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace housingsafety.server.Models
{
    public class BuildingDto
    {
        public string Id { get; set; }

        public string Bh { get; set; } 

        public string Province { get; set; }

        public string City { get; set; }

        public string Xzqdm { get; set; }

        public string Town { get; set; }

        public string Village { get; set; }

        public string ProvinceAlias { get; set; }

        public string CityAlias { get; set; }

        public string XzqdmAlias { get; set; }

        public string TownAlias { get; set; }

        public string VillageAlias { get; set; }

        public string ZuQg { get; set; }

        public string LuQg { get; set; }

        public string HaoQg { get; set; }

        public string Address { get; set; }

        public long? Cs { get; set; }

        public string Fwbh { get; set; }

        public string Yhfwbh { get; set; }

        public string Geometry { get; set; }

        /// <summary>
        /// 住建排查状态(0-未排查,1-排查中,20-已排查无隐患,21-已排查有隐患,3不需要排查)
        /// </summary>
        public int? PcztHousing { get; set; }
        /// <summary>
        /// 消防排查状态(0-未排查,1-排查中,20-已排查无隐患,21-已排查有隐患,3不需要排查)
        /// </summary>
        public int? PcztFire { get; set; }
        /// <summary>
        /// 公安排查状态(0-未排查,1-排查中,20-已排查无隐患,21-已排查有隐患,3不需要排查)
        /// </summary>
        public int? PcztPolice { get; set; }

        /// <summary>
        /// 户主姓名
        /// </summary>
        public string Hzxm { get; set; }

        /// <summary>
        /// 级别
        /// </summary>
        public int? Level { get; set; }

        /// <summary>
        /// 住建(1-严重隐患;2-无隐患;3-一般隐患)
        /// </summary>
        public int? LevelHousing { get; set; } = 2;

        /// <summary>
        /// 消防(1-严重隐患;2-无隐患;3-一般隐患)
        /// </summary>
        public int? LevelFire { get; set; } = 2;

        /// <summary>
        /// 公安(1-严重隐患;2-无隐患;3-一般隐患)
        /// </summary>
        public int? LevelPolice { get; set; } = 2;

        /// <summary>
        /// 几何BoundingBox
        /// </summary>
        public ZmRect BoundingBox { get; set; }

        public double Lng { get; set; }
        public double Lat { get; set; }

        public DateTime? ModifiedOn { get; set; }

        public string Bz { get; set; }

        public double? Dcmj { get; set; }

        public string Mc { get; set; }

        public string BuildTime { get; set; }
    }




    public partial class FwlbDto
    {

        [Key]
        [Column("id")]
        [StringLength(50)]
        public string Id { get; set; }

        [Column("fwbh")]
        [StringLength(50)]
        public string? Fwbh { get; set; }

        // 下面是第二个表的字段信息
        [Column("pczt")]
        public short? Pczt { get; set; }

        // 下面是第二个表的字段信息
        [Column("geometry")]
        public string? Geometry { get; set; }


        [Column("zczt")]
        public short? Zczt { get; set; }

        [Column("feature")]
        public string? Feature { get; set; }

        [Column("hzxm")]
        [StringLength(255)]
        public string? Hzxm { get; set; }


        [Column("day_difference")]
        [StringLength(255)]
        public string? Daydifference { get; set; }


        [Column("address")]
        public string? Address { get; set; }
    }

    /// <summary>
    /// 房屋基础信息
    /// </summary>
    public class BuildingAttrDto
    {
        public string Id { get; set; }
        public string xzqdm { get; set; }
        public string xzq { get; set; }
        public string fwbh { get; set; }
        public string zzmj { get; set; }
        public string towndm { get; set; }
        public Geometry Geom { get; set; }
        public string yhfwbh { get; set; }
        public string address { get; set; }
        public string cs { get; set; }
        public string villagedm { get; set; }
        public string build_time { get; set; }
        public string aqyhqk { get; set; }
        public string bdlx { get; set; }
        public string bdtime { get; set; }
        public string fwlx { get; set; }
        public string hzxm { get; set; }
        public string village { get; set; }
        public string town { get; set; }
        public int jzrks { get; set; }
        public int zzrs { get; set; }
        public int jzfjs { get; set; }
        public int fjsl { get; set; }
        public int jzscxyaqcksl { get; set; }
        public decimal jzscmj { get; set; }
        public int jzszlwxdlgybjqs { get; set; }
        public int jzsyjyplmhxts { get; set; }
        public string jzxyssltsl { get; set; }
        public int pc_status { get; set; }
        public int ckfhwggptzlsl { get; set; }
        public int bdfwjzrydddzxcsl { get; set; }
        public int mhqsl { get; set; }
        public int fytsmz { get; set; }
        public int xggdjsbp { get; set; }
        public int wdwhjgfjgqsyyrkrgbdj { get; set; }
        public int sstdsyyrkrclzx { get; set; }
        public int gryssdcsszblyyqksddp { get; set; }
        public string cjzwqtjyytmsg { get; set; }
        public string jsrysstd { get; set; }
        public string sstdjsqk { get; set; }
        public int cjzwqtjyyt { get; set; }


    }

    public class BuildingGeomDto
    {



       
        public string Id { get; set; }

        public string Yhfwbh { get; set; }

        public string Fwbh { get; set; }

        public string Address { get; set; }
        public string jcyhcount { get; set; }//备注
        public string zcyhcount { get; set; }//备注
        public string pczt2 { get; set; }//备注
        public string add2 { get; set; }//备注
        public string hzxm { get; set; }//户主姓名

        public string Geometry { get; set; }
        
        
        public double Lng { get; set; }

        public double Lat { get; set; }

        /// <summary>
        /// 几何BoundingBox
        /// </summary>
        public ZmRect BoundingBox { get; set; }

        public double XMin { get; set; }

        public double YMin { get; set; }

        public double XMax { get; set; }

        public double YMax { get; set; }


    }


    public class Xzq
    {
        public string Id{get;set;}
        public string RegionName { get; set; }
        public string RegionCode { get; set; }
    }
}
